﻿@model OMS.Models.UserModelView

@{
    ViewBag.Title = "AddUser";
}

<h2>AddUser</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
        <table align=center>
            <tr>
                <td>@Html.LabelFor(m => m.Login)</td>
                <td>@Html.EditorFor(m => m.Login)</td>
                <td>@Html.ValidationMessageFor(m => m.Login)</td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.FirstName)</td>
                <td>@Html.EditorFor(m => m.FirstName)</td>
                <td>@Html.ValidationMessageFor(m => m.FirstName)</td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.LastName)</td>
                <td>@Html.EditorFor(m => m.LastName)</td>
                <td>@Html.ValidationMessageFor(m => m.LastName)</td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.Password)</td>
                <td>@Html.PasswordFor(m => m.Password)</td>
                <td>@Html.ValidationMessageFor(m => m.Password)</td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.ConfirmPassword)</td>
                <td>@Html.PasswordFor(m => m.ConfirmPassword)</td>
                <td>@Html.ValidationMessageFor(m => m.ConfirmPassword)</td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.Email)</td>
                <td>@Html.EditorFor(m => m.Email)</td>
                <td>@Html.ValidationMessageFor(m => m.Email)</td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.Region)</td>
                <td>@Html.DropDownListFor(m => m.Region, new SelectList(new string[] { "West", "East", "North", "South" }))</td>
                <td>@Html.ValidationMessageFor(m => m.Region)</td>
            </tr>
            <tr>
                <td>@Html.LabelFor(m => m.Role)</td>
                <td>
                    @Html.RadioButtonFor(m => m.Role,"admin") Administrator<br /> 
                    @Html.RadioButtonFor(m => m.Role,"super") Supervisor<br />
                    @Html.RadioButtonFor(m => m.Role,"merch") Merchandiser<br />
                    @Html.RadioButtonFor(m => m.Role,"customer") Customer<br />
                </td>
            </tr>
        </table>
        <button type="submit" value="Create User">Add user</button>
}
<br />
<div>
    @Html.ActionLink("Back to Admin", "Index")
</div>
